<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateDistributionWithdrawsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('distribution_withdraws', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('user_id')       ->default(0)->comment('用户id');
            $table->bigInteger('img_id')        ->default(0)->comment('用户头像');
            $table->string('name')              ->default('')->comment('真实姓名');
            $table->string('phone')             ->default('')->comment('手机');
            $table->decimal('withdraws_amount') ->default(0)->comment('提现金额');
            $table->string('withdraws_way')     ->default('')->comment('提现方式：wechat微信');
            $table->string('withdrawal_num')    ->default('')->comment('提现单号');
            $table->timestamp('submit_time')    ->nullable()        ->comment('提交时间');
            $table->integer('review_status')    ->default(0)->comment('审核状态：0待处理，1审核通过，2审核拒绝');
            $table->integer('transfer_status')  ->default(0)->comment('转账状态：0待处理，1转账完成，2转账失败，3转帐中');
            $table->integer('review_user_id')   ->default(0)->comment('审核操作者');
            $table->integer('transfer_user_id') ->default(0)->comment('转账操作者');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('distribution_withdraws');
    }
}
